package HashBuck;

import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-07-30
 * Time: 21:51
 */
class Person {
    public String id;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(id, person.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

}
public class Test {
    public static void main1(String[] args) {
        Person person1 = new Person();
        Person person2 = new Person();

        System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());

        System.out.println(person1.equals(person2));
    }

    public static void main(String[] args) {
        MyHashBuck myHashBuck = new MyHashBuck();
        myHashBuck.push(1,4);
        myHashBuck.push(11,4);
        myHashBuck.push(3,4);
        myHashBuck.push(13,4);
        myHashBuck.push(6,4);
        myHashBuck.push(16,4);
        myHashBuck.push(5,4);
        myHashBuck.push(15,4);

        System.out.println(myHashBuck.getVal(15));



    }
}
